1. Field of the Invention
The present invention relates to a technique which handles an image encoded to be decodable at a plurality of resolutions.
2. Description of the Related Art
Digital cameras that have prevailed in recent years have enormous numbers of pixels, and those which have about two to five million pixels are popular. Furthermore, professional digital cameras of 10 million pixel classes have begun to prevail, and appearance of higher-definition digital cameras in the future is easily conceivable.
An application which handles an image having such a large size often generates a plurality of resolution data and stores them in one file. There are mainly two saving methods of the plurality of resolution data.
In one method, a plurality of resolution data which are completely independent from an original image are generated, and are subsequently saved in one file. In the other method, an original image is encoded using an encoding method having resolution scalability to save the encoded data. Exif/DCF created by a digital still camera is an example of the former, and the JPEG2000 file format is that of the latter.
Japanese Patent Laid-Open No. 06-078157 discloses a method of saving a plurality of original images using the encoding method having resolution scalability.
With this method, encoded data in an image file is divisionally saved in a memory area.
Each group includes one or a plurality of rank data, and the saving start position in the memory area and data read direction are designated for each group. In this way, new image data can be easily added without forming any blank space.
As an example, a case will be examined below wherein data of rank 0 to 2 form group 1, those of rank 3 to 5 form group 2, and that of rank 6 forms group 3.
In this case, after data of group 1 of image 0 is written from the head position toward the backward positions in the memory area, data of group 1 of image 1, data of group 1 of image 2, . . . , are written in turn.
Data of group 2 are written from the middle position in the memory area toward the head position of the memory area like data of group 2 of image 0, that of group 2 of image 1, that of group 2 of image 2, . . . .
Furthermore, data are written from the rearmost position of the memory area toward the head position of the memory like data of group 3 of image 0, that of group 3 of image 1, that of group 3 of image 2, . . . .
As an example of the former method that saves a plurality of independent data Exif/DCF created by digital still cameras is known. Exif/DCF creates a thumbnail image from an original image as independent image data, and saves the thumbnail image and original image in one file. Upon saving images of required resolutions in one file, since only images of the resolutions which have one-to-one correspondence with thumbnail display that an application always uses, and full-screen display are saved, the application can easily use such images.
However, since all images are independent encoded data, they include much redundant data. When the number of types of image sizes to be saved in one file increases, the image file size becomes large.
As the latter method that saves using the encoding method having resolution scalability, for example, JPEG2000 is known. Since the JPEG2000 encoding method uses difference data between respective resolutions, even if a plurality of resolutions of images is provided, its file size does not increase. However, in JPEG2000, a certain resolution image has a size obtained by halving the horizontal and vertical sizes of a resolution image one level higher than the certain resolution image, and more resolutions are provided in addition to those which are used frequently.
The above reference discloses a device to save a plurality of images within a predetermined capacity. This saves difference data between respective resolutions in turn from encoded data of a low-resolution image, as in the JPEG2000 file format, as long as the free capacity of the memory remains.
Therefore, more resolutions are provided in addition to those which are frequently used.
Since the head positions of the area to be saved and data write directions are different for respective groups, a long memory seek time is required depending on grouping methods.
That is, in the aforementioned example, in order to read data of rank 3 of image 1, the head position where the data of group 0 of image 1 is detected from the head position of the memory area, and data of group 0 are read from that position in the backward direction of the memory area. Then, the head position where data of group 1 of image 1 is detected, and data of rank 3 is read from that position in the forward direction of the memory area.
Since JPEG2000 encoded data has a high degree of freedom, even when a file of encoded data is saved as a cluster, data required for display do not always form a cluster and may be scattered all over the file. For this reason, the application must search for data to be decoded so as to obtain an image of a required resolution, resulting in an increase in number of seek times in the file. Hence, it is difficult to shorten the display time.
When the application that handles high-definition images saves only required resolution images, independent image data are generated for respective resolutions, and image data which originally have large data sizes form a file of a still larger size. With the method of preparing images of resolutions required by the application using encoded data which use difference data and have scalability, the file size remains unchanged, but even images of unnecessary resolutions are prepared. Furthermore, with this method, every time the application uses images, it must analyze encoded data and select a required resolution image from a plurality of resolution images.